﻿namespace WinForms.ControlList.Company
{
    using Bll.Company;
    using Bll.Systems;
    using Model.Company;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.Properties;

    public class FrmCompayAccountEdit : Form
    {
        private Button btn_Close;
        private Button btn_Save;
        private IContainer components;
        private ComboBoxNew drp_AccountType;
        private ComboBoxNew drp_BankType;
        private ComboBoxNew drp_IsUse;
        public const int HTCAPTION = 2;
        private int id;
        private Label lbl_AccountMoney;
        private Label lbl_AccountName;
        private Label lbl_AccountNum;
        private Label lbl_AccountType;
        private Label lbl_BankType;
        private Label lbl_BiTian;
        private Label lbl_IsUse;
        private Label lbl_TiShi;
        private Label lbl_TiShi2;
        private Label lblTitle;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Table2;
        private Panel pan_Table3;
        private Panel pan_Table4;
        private Panel pan_td0;
        private Panel pan_td1;
        private Panel pan_td10;
        private Panel pan_td11;
        private Panel pan_td2;
        private Panel pan_td3;
        private Panel pan_td4;
        private Panel pan_td5;
        private Panel pan_td6;
        private Panel pan_td7;
        private Panel pan_td8;
        private Panel pan_td9;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_BiTian;
        private Panel panel_Button;
        private Panel panel_JianGe1;
        private Panel panel9;
        public FrmPrompt prom;
        public const int SC_MOVE = 0xf010;
        private TextBox txt_AccountMoney;
        private TextBox txt_AccountName;
        private TextBox txt_AccountNum;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmCompayAccountEdit()
        {
            this.prom = null;
            this.id = 0;
            this.components = null;
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.DropLoad();
            this.txt_AccountName.Select();
            base.KeyPreview = true;
            base.KeyDown += new KeyEventHandler(this.Form_KeyDown);
        }

        public FrmCompayAccountEdit(int id) : this()
        {
            this.id = id;
            CompayAccountEnt model = CompayAccountBll.GetModel(id);
            this.txt_AccountMoney.Text = model.AccountMoney.ToString("F2");
            this.txt_AccountName.Text = model.AccountName.ToString();
            if (model.IsUse.ToString() == "1")
            {
                this.drp_IsUse.Text = "使用";
            }
            else
            {
                this.drp_IsUse.Text = "不使用";
            }
            this.drp_AccountType.SelectedValue = model.AccountType.ToString();
            this.txt_AccountNum.Text = model.AccountNum.ToString();
            this.drp_BankType.SelectedValue = model.BankType.ToString();
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.DialogResult = DialogResult.Cancel;
            base.Close();
        }

        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txt_AccountMoney.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入帐户余额!");
                    this.prom.ShowDialog();
                    this.txt_AccountMoney.Select();
                }
                else if (this.txt_AccountName.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请输入帐户名称!");
                    this.prom.ShowDialog();
                    this.txt_AccountName.Select();
                }
                else if (this.drp_IsUse.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请选择是否使用");
                    this.prom.ShowDialog();
                    this.drp_IsUse.Select();
                }
                else if (this.drp_AccountType.Text.Trim() == "")
                {
                    this.prom = new FrmPrompt(false, "请选择帐户类型");
                    this.prom.ShowDialog();
                    this.drp_AccountType.Select();
                }
                else
                {
                    CompayAccountEnt model = CompayAccountBll.GetModel(this.id);
                    model.AccountMoney = decimal.Parse(this.txt_AccountMoney.Text.Trim());
                    model.AccountName = this.txt_AccountName.Text.Trim();
                    if (this.drp_IsUse.Text == "使用")
                    {
                        model.IsUse = 1;
                    }
                    else
                    {
                        model.IsUse = 0;
                    }
                    model.AccountType = int.Parse(this.drp_AccountType.SelectValueNew);
                    model.AccountNum = this.txt_AccountNum.Text.Trim();
                    model.BankType = int.Parse(this.drp_BankType.SelectValueNew);
                    CompayAccountBll.Update(model);
                    PublicAppliction.ReloadCompanyAccountCatch();
                    this.prom = new FrmPrompt(true, "帐户修改成功");
                    this.prom.ShowDialog();
                    WorkLogBll.AddNewLog("帐户修改成功", "FrmCompanyAccountEdit", PublicAppliction.LoginUser);
                    base.DialogResult = DialogResult.OK;
                    base.Close();
                }
            }
            catch (Exception exception)
            {
                ErrorsBll.NewException(exception, PublicAppliction.LoginUser);
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void DropLoad()
        {
            this.drp_IsUse.SelectedIndex = 0;
            this.drp_AccountType.BeginUpdate();
            this.drp_AccountType.Items.Clear();
            DataRow[] rowArray = PublicAppliction.ParDt.Select("ParRefName='AccountType'");
            foreach (DataRow row in rowArray)
            {
                this.drp_AccountType.AddItem(row["parName"].ToString(), row["parid"].ToString());
            }
            if (rowArray.Length > 0)
            {
                this.drp_AccountType.SelectedIndex = 0;
            }
            this.drp_AccountType.EndUpdate();
            this.drp_BankType.BeginUpdate();
            this.drp_BankType.Items.Clear();
            this.drp_BankType.Items.Add(new ComboxItem("请选择", "0"));
            DataRow[] rowArray2 = PublicAppliction.ParDt.Select("ParRefName='BankType'");
            foreach (DataRow row in rowArray2)
            {
                this.drp_BankType.AddItem(row["parName"].ToString(), row["parid"].ToString());
            }
            if (rowArray2.Length > 0)
            {
                this.drp_BankType.SelectedIndex = 0;
            }
            this.drp_BankType.EndUpdate();
        }

        private void drp_AccountType_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.drp_IsUse.Select();
            }
        }

        private void drp_AccountType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.drp_AccountType.Text.IndexOf("现金") >= 0)
            {
                this.pan_Table4.Visible = false;
                base.Height -= 0x17;
            }
            else
            {
                this.pan_Table4.Visible = true;
                base.Height += 0x17;
            }
        }

        private void drp_BankType_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.txt_AccountNum.Select();
            }
        }

        private void drp_IsUse_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.drp_BankType.Select();
            }
        }

        protected void Form_KeyDown(object sender, KeyEventArgs e)
        {
            if ((e.Control && (e.KeyCode == Keys.S)) && (MessageBox.Show("您确定要保存吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK))
            {
                this.btn_Save_Click(null, null);
            }
        }

        private void InitializeComponent()
        {
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_DockLeft = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.panel_JianGe1 = new Panel();
            this.pan_Table4 = new Panel();
            this.pan_td11 = new Panel();
            this.txt_AccountNum = new TextBox();
            this.pan_td10 = new Panel();
            this.lbl_AccountNum = new Label();
            this.pan_td9 = new Panel();
            this.drp_BankType = new ComboBoxNew();
            this.pan_td8 = new Panel();
            this.lbl_BankType = new Label();
            this.pan_Table3 = new Panel();
            this.pan_td7 = new Panel();
            this.drp_IsUse = new ComboBoxNew();
            this.pan_td6 = new Panel();
            this.lbl_IsUse = new Label();
            this.pan_td5 = new Panel();
            this.drp_AccountType = new ComboBoxNew();
            this.pan_td4 = new Panel();
            this.lbl_AccountType = new Label();
            this.pan_Table2 = new Panel();
            this.pan_td3 = new Panel();
            this.txt_AccountMoney = new TextBox();
            this.pan_td2 = new Panel();
            this.lbl_AccountMoney = new Label();
            this.pan_td1 = new Panel();
            this.txt_AccountName = new TextBox();
            this.pan_td0 = new Panel();
            this.lbl_AccountName = new Label();
            this.panel_BiTian = new Panel();
            this.lbl_BiTian = new Label();
            this.panel_Button = new Panel();
            this.lbl_TiShi2 = new Label();
            this.lbl_TiShi = new Label();
            this.btn_Close = new Button();
            this.btn_Save = new Button();
            this.panel9 = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_Top = new Panel();
            this.pan_TopLeft = new Panel();
            this.pan_ZhongJian.SuspendLayout();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            this.pan_Table4.SuspendLayout();
            this.pan_td11.SuspendLayout();
            this.pan_td10.SuspendLayout();
            this.pan_td9.SuspendLayout();
            this.pan_td8.SuspendLayout();
            this.pan_Table3.SuspendLayout();
            this.pan_td7.SuspendLayout();
            this.pan_td6.SuspendLayout();
            this.pan_td5.SuspendLayout();
            this.pan_td4.SuspendLayout();
            this.pan_Table2.SuspendLayout();
            this.pan_td3.SuspendLayout();
            this.pan_td2.SuspendLayout();
            this.pan_td1.SuspendLayout();
            this.pan_td0.SuspendLayout();
            this.panel_BiTian.SuspendLayout();
            this.panel_Button.SuspendLayout();
            this.pan_Top.SuspendLayout();
            base.SuspendLayout();
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x312, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x3f, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "修改帐户";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x331, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0xb7);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x336, 0xb7);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(820, 0xb6);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.panel_JianGe1);
            this.pan_AllPlanes.Controls.Add(this.pan_Table4);
            this.pan_AllPlanes.Controls.Add(this.pan_Table3);
            this.pan_AllPlanes.Controls.Add(this.pan_Table2);
            this.pan_AllPlanes.Controls.Add(this.panel_BiTian);
            this.pan_AllPlanes.Controls.Add(this.panel_Button);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(800, 0xa2);
            this.pan_AllPlanes.TabIndex = 4;
            this.panel_JianGe1.Dock = DockStyle.Top;
            this.panel_JianGe1.Location = new Point(0, 100);
            this.panel_JianGe1.Name = "panel_JianGe1";
            this.panel_JianGe1.Size = new Size(800, 10);
            this.panel_JianGe1.TabIndex = 0;
            this.pan_Table4.Controls.Add(this.pan_td11);
            this.pan_Table4.Controls.Add(this.pan_td10);
            this.pan_Table4.Controls.Add(this.pan_td9);
            this.pan_Table4.Controls.Add(this.pan_td8);
            this.pan_Table4.Dock = DockStyle.Top;
            this.pan_Table4.Location = new Point(0, 0x4b);
            this.pan_Table4.Name = "pan_Table4";
            this.pan_Table4.Size = new Size(800, 0x19);
            this.pan_Table4.TabIndex = 1;
            this.pan_Table4.Visible = false;
            this.pan_td11.Controls.Add(this.txt_AccountNum);
            this.pan_td11.Dock = DockStyle.Left;
            this.pan_td11.Location = new Point(550, 0);
            this.pan_td11.Name = "pan_td11";
            this.pan_td11.Size = new Size(250, 0x19);
            this.pan_td11.TabIndex = 0;
            this.pan_td11.Paint += new PaintEventHandler(this.pan_td11_Paint);
            this.txt_AccountNum.Location = new Point(3, 2);
            this.txt_AccountNum.MaxLength = 20;
            this.txt_AccountNum.Name = "txt_AccountNum";
            this.txt_AccountNum.Size = new Size(230, 0x15);
            this.txt_AccountNum.TabIndex = 0x2a;
            this.txt_AccountNum.KeyPress += new KeyPressEventHandler(this.txt_AccountNum_KeyPress);
            this.pan_td10.Controls.Add(this.lbl_AccountNum);
            this.pan_td10.Dock = DockStyle.Left;
            this.pan_td10.Location = new Point(400, 0);
            this.pan_td10.Name = "pan_td10";
            this.pan_td10.Size = new Size(150, 0x19);
            this.pan_td10.TabIndex = 1;
            this.pan_td10.Paint += new PaintEventHandler(this.pan_td10_Paint);
            this.lbl_AccountNum.Location = new Point(0x3e, 5);
            this.lbl_AccountNum.Name = "lbl_AccountNum";
            this.lbl_AccountNum.Size = new Size(0x54, 12);
            this.lbl_AccountNum.TabIndex = 0;
            this.lbl_AccountNum.Text = "银行帐户:";
            this.lbl_AccountNum.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td9.Controls.Add(this.drp_BankType);
            this.pan_td9.Dock = DockStyle.Left;
            this.pan_td9.Location = new Point(150, 0);
            this.pan_td9.Name = "pan_td9";
            this.pan_td9.Size = new Size(250, 0x19);
            this.pan_td9.TabIndex = 2;
            this.pan_td9.Paint += new PaintEventHandler(this.pan_td9_Paint);
            this.drp_BankType.DisplayMember = "Name";
            this.drp_BankType.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_BankType.FormattingEnabled = true;
            this.drp_BankType.Location = new Point(3, 3);
            this.drp_BankType.Name = "drp_BankType";
            this.drp_BankType.SelectValueNew = "";
            this.drp_BankType.Size = new Size(230, 20);
            this.drp_BankType.TabIndex = 1;
            this.drp_BankType.ValueMember = "Value";
            this.drp_BankType.KeyPress += new KeyPressEventHandler(this.drp_BankType_KeyPress);
            this.pan_td8.Controls.Add(this.lbl_BankType);
            this.pan_td8.Dock = DockStyle.Left;
            this.pan_td8.Location = new Point(0, 0);
            this.pan_td8.Name = "pan_td8";
            this.pan_td8.Size = new Size(150, 0x19);
            this.pan_td8.TabIndex = 3;
            this.pan_td8.Paint += new PaintEventHandler(this.pan_td8_Paint);
            this.lbl_BankType.Location = new Point(0x3e, 5);
            this.lbl_BankType.Name = "lbl_BankType";
            this.lbl_BankType.Size = new Size(0x54, 12);
            this.lbl_BankType.TabIndex = 0;
            this.lbl_BankType.Text = "所属银行:";
            this.lbl_BankType.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table3.Controls.Add(this.pan_td7);
            this.pan_Table3.Controls.Add(this.pan_td6);
            this.pan_Table3.Controls.Add(this.pan_td5);
            this.pan_Table3.Controls.Add(this.pan_td4);
            this.pan_Table3.Dock = DockStyle.Top;
            this.pan_Table3.Location = new Point(0, 50);
            this.pan_Table3.Name = "pan_Table3";
            this.pan_Table3.Size = new Size(800, 0x19);
            this.pan_Table3.TabIndex = 4;
            this.pan_td7.Controls.Add(this.drp_IsUse);
            this.pan_td7.Dock = DockStyle.Left;
            this.pan_td7.Location = new Point(550, 0);
            this.pan_td7.Name = "pan_td7";
            this.pan_td7.Size = new Size(250, 0x19);
            this.pan_td7.TabIndex = 0;
            this.pan_td7.Paint += new PaintEventHandler(this.pan_td7_Paint);
            this.drp_IsUse.DisplayMember = "Name";
            this.drp_IsUse.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_IsUse.FormattingEnabled = true;
            this.drp_IsUse.Items.AddRange(new object[] { "使用", "不使用" });
            this.drp_IsUse.Location = new Point(3, 2);
            this.drp_IsUse.Name = "drp_IsUse";
            this.drp_IsUse.SelectValueNew = "";
            this.drp_IsUse.Size = new Size(230, 20);
            this.drp_IsUse.TabIndex = 1;
            this.drp_IsUse.ValueMember = "Value";
            this.drp_IsUse.KeyPress += new KeyPressEventHandler(this.drp_IsUse_KeyPress);
            this.pan_td6.Controls.Add(this.lbl_IsUse);
            this.pan_td6.Dock = DockStyle.Left;
            this.pan_td6.Location = new Point(400, 0);
            this.pan_td6.Name = "pan_td6";
            this.pan_td6.Size = new Size(150, 0x19);
            this.pan_td6.TabIndex = 1;
            this.pan_td6.Paint += new PaintEventHandler(this.pan_td6_Paint);
            this.lbl_IsUse.Location = new Point(0x3e, 5);
            this.lbl_IsUse.Name = "lbl_IsUse";
            this.lbl_IsUse.Size = new Size(0x54, 12);
            this.lbl_IsUse.TabIndex = 0;
            this.lbl_IsUse.Text = "是否使用:";
            this.lbl_IsUse.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td5.Controls.Add(this.drp_AccountType);
            this.pan_td5.Dock = DockStyle.Left;
            this.pan_td5.Location = new Point(150, 0);
            this.pan_td5.Name = "pan_td5";
            this.pan_td5.Size = new Size(250, 0x19);
            this.pan_td5.TabIndex = 2;
            this.pan_td5.Paint += new PaintEventHandler(this.pan_td5_Paint);
            this.drp_AccountType.DisplayMember = "Name";
            this.drp_AccountType.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_AccountType.FormattingEnabled = true;
            this.drp_AccountType.Location = new Point(3, 2);
            this.drp_AccountType.Name = "drp_AccountType";
            this.drp_AccountType.SelectValueNew = "";
            this.drp_AccountType.Size = new Size(230, 20);
            this.drp_AccountType.TabIndex = 0;
            this.drp_AccountType.ValueMember = "Value";
            this.drp_AccountType.SelectedIndexChanged += new EventHandler(this.drp_AccountType_SelectedIndexChanged);
            this.drp_AccountType.KeyPress += new KeyPressEventHandler(this.drp_AccountType_KeyPress);
            this.pan_td4.Controls.Add(this.lbl_AccountType);
            this.pan_td4.Dock = DockStyle.Left;
            this.pan_td4.Location = new Point(0, 0);
            this.pan_td4.Name = "pan_td4";
            this.pan_td4.Size = new Size(150, 0x19);
            this.pan_td4.TabIndex = 3;
            this.pan_td4.Paint += new PaintEventHandler(this.pan_td4_Paint);
            this.lbl_AccountType.Location = new Point(0x3e, 5);
            this.lbl_AccountType.Name = "lbl_AccountType";
            this.lbl_AccountType.Size = new Size(0x54, 12);
            this.lbl_AccountType.TabIndex = 0;
            this.lbl_AccountType.Text = "帐户类型:";
            this.lbl_AccountType.TextAlign = ContentAlignment.MiddleRight;
            this.pan_Table2.Controls.Add(this.pan_td3);
            this.pan_Table2.Controls.Add(this.pan_td2);
            this.pan_Table2.Controls.Add(this.pan_td1);
            this.pan_Table2.Controls.Add(this.pan_td0);
            this.pan_Table2.Dock = DockStyle.Top;
            this.pan_Table2.Location = new Point(0, 0x19);
            this.pan_Table2.Name = "pan_Table2";
            this.pan_Table2.Size = new Size(800, 0x19);
            this.pan_Table2.TabIndex = 5;
            this.pan_td3.Controls.Add(this.txt_AccountMoney);
            this.pan_td3.Dock = DockStyle.Left;
            this.pan_td3.Location = new Point(550, 0);
            this.pan_td3.Name = "pan_td3";
            this.pan_td3.Size = new Size(250, 0x19);
            this.pan_td3.TabIndex = 0;
            this.pan_td3.Paint += new PaintEventHandler(this.pan_td3_Paint);
            this.txt_AccountMoney.Location = new Point(3, 2);
            this.txt_AccountMoney.MaxLength = 20;
            this.txt_AccountMoney.Name = "txt_AccountMoney";
            this.txt_AccountMoney.Size = new Size(230, 0x15);
            this.txt_AccountMoney.TabIndex = 0x29;
            this.txt_AccountMoney.Text = "0.00";
            this.txt_AccountMoney.KeyPress += new KeyPressEventHandler(this.txt_AccountMoney_KeyPress);
            this.pan_td2.Controls.Add(this.lbl_AccountMoney);
            this.pan_td2.Dock = DockStyle.Left;
            this.pan_td2.Location = new Point(400, 0);
            this.pan_td2.Name = "pan_td2";
            this.pan_td2.Size = new Size(150, 0x19);
            this.pan_td2.TabIndex = 1;
            this.pan_td2.Paint += new PaintEventHandler(this.pan_td2_Paint);
            this.lbl_AccountMoney.Location = new Point(0x3e, 5);
            this.lbl_AccountMoney.Name = "lbl_AccountMoney";
            this.lbl_AccountMoney.Size = new Size(0x54, 12);
            this.lbl_AccountMoney.TabIndex = 0;
            this.lbl_AccountMoney.Text = "帐户余额:";
            this.lbl_AccountMoney.TextAlign = ContentAlignment.MiddleRight;
            this.pan_td1.Controls.Add(this.txt_AccountName);
            this.pan_td1.Dock = DockStyle.Left;
            this.pan_td1.Location = new Point(150, 0);
            this.pan_td1.Name = "pan_td1";
            this.pan_td1.Size = new Size(250, 0x19);
            this.pan_td1.TabIndex = 2;
            this.pan_td1.Paint += new PaintEventHandler(this.pan_td1_Paint);
            this.txt_AccountName.Location = new Point(3, 2);
            this.txt_AccountName.MaxLength = 20;
            this.txt_AccountName.Name = "txt_AccountName";
            this.txt_AccountName.Size = new Size(230, 0x15);
            this.txt_AccountName.TabIndex = 4;
            this.txt_AccountName.KeyPress += new KeyPressEventHandler(this.txt_AccountName_KeyPress);
            this.pan_td0.Controls.Add(this.lbl_AccountName);
            this.pan_td0.Dock = DockStyle.Left;
            this.pan_td0.Location = new Point(0, 0);
            this.pan_td0.Name = "pan_td0";
            this.pan_td0.Size = new Size(150, 0x19);
            this.pan_td0.TabIndex = 3;
            this.pan_td0.Paint += new PaintEventHandler(this.pan_td0_Paint);
            this.lbl_AccountName.Location = new Point(0x3e, 5);
            this.lbl_AccountName.Name = "lbl_AccountName";
            this.lbl_AccountName.Size = new Size(0x54, 12);
            this.lbl_AccountName.TabIndex = 0;
            this.lbl_AccountName.Text = "帐户名称:";
            this.lbl_AccountName.TextAlign = ContentAlignment.MiddleRight;
            this.panel_BiTian.Controls.Add(this.lbl_BiTian);
            this.panel_BiTian.Dock = DockStyle.Top;
            this.panel_BiTian.Location = new Point(0, 0);
            this.panel_BiTian.Name = "panel_BiTian";
            this.panel_BiTian.Size = new Size(800, 0x19);
            this.panel_BiTian.TabIndex = 6;
            this.panel_BiTian.Paint += new PaintEventHandler(this.panel_BiTian_Paint);
            this.lbl_BiTian.AutoSize = true;
            this.lbl_BiTian.Location = new Point(10, 6);
            this.lbl_BiTian.Name = "lbl_BiTian";
            this.lbl_BiTian.Size = new Size(0x35, 12);
            this.lbl_BiTian.TabIndex = 0;
            this.lbl_BiTian.Text = "基本项目";
            this.panel_Button.Controls.Add(this.lbl_TiShi2);
            this.panel_Button.Controls.Add(this.lbl_TiShi);
            this.panel_Button.Controls.Add(this.btn_Close);
            this.panel_Button.Controls.Add(this.btn_Save);
            this.panel_Button.Dock = DockStyle.Bottom;
            this.panel_Button.Location = new Point(0, 0x72);
            this.panel_Button.Name = "panel_Button";
            this.panel_Button.Size = new Size(800, 0x2b);
            this.panel_Button.TabIndex = 7;
            this.panel_Button.Paint += new PaintEventHandler(this.panel_Button_Paint);
            this.lbl_TiShi2.AutoSize = true;
            this.lbl_TiShi2.Location = new Point(0x243, 15);
            this.lbl_TiShi2.Name = "lbl_TiShi2";
            this.lbl_TiShi2.Size = new Size(0xcb, 12);
            this.lbl_TiShi2.TabIndex = 0x10;
            this.lbl_TiShi2.Text = "使用小技巧: Ctrl+S 快速保存 记录.";
            this.lbl_TiShi.AutoSize = true;
            this.lbl_TiShi.Location = new Point(10, 15);
            this.lbl_TiShi.Name = "lbl_TiShi";
            this.lbl_TiShi.Size = new Size(0xef, 12);
            this.lbl_TiShi.TabIndex = 15;
            this.lbl_TiShi.Text = "使用小技巧:回车(Enter)跳到下一个输入项.";
            this.btn_Close.Location = new Point(0x1ad, 10);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 0;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.btn_Save.Location = new Point(0x128, 10);
            this.btn_Save.Name = "btn_Save";
            this.btn_Save.Size = new Size(0x4b, 0x17);
            this.btn_Save.TabIndex = 1;
            this.btn_Save.Text = "保 存";
            this.btn_Save.UseVisualStyleBackColor = true;
            this.btn_Save.Click += new EventHandler(this.btn_Save_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0x9d);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(800, 5);
            this.panel9.TabIndex = 3;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(810, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0xa2);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0xa2);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0xac);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(820, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(820, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0xb6);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(820, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x335, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0xb7);
            this.pan_DockRight.TabIndex = 1;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x336, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x336, 0xd7);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = FormBorderStyle.None;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmCompayAccountEdit";
            base.ShowInTaskbar = false;
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            this.pan_Table4.ResumeLayout(false);
            this.pan_td11.ResumeLayout(false);
            this.pan_td11.PerformLayout();
            this.pan_td10.ResumeLayout(false);
            this.pan_td9.ResumeLayout(false);
            this.pan_td8.ResumeLayout(false);
            this.pan_Table3.ResumeLayout(false);
            this.pan_td7.ResumeLayout(false);
            this.pan_td6.ResumeLayout(false);
            this.pan_td5.ResumeLayout(false);
            this.pan_td4.ResumeLayout(false);
            this.pan_Table2.ResumeLayout(false);
            this.pan_td3.ResumeLayout(false);
            this.pan_td3.PerformLayout();
            this.pan_td2.ResumeLayout(false);
            this.pan_td1.ResumeLayout(false);
            this.pan_td1.PerformLayout();
            this.pan_td0.ResumeLayout(false);
            this.panel_BiTian.ResumeLayout(false);
            this.panel_BiTian.PerformLayout();
            this.panel_Button.ResumeLayout(false);
            this.panel_Button.PerformLayout();
            this.pan_Top.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void pan_td0_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td0, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td1_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td1, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td10_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td10, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td11_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td11, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td2_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td2, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td3_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td3, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td4_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td4, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td5_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td5, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td6_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td6, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td7_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td7, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_td8_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td8, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void pan_td9_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.pan_td9, Color.FromArgb(0xca, 0xc9, 0xce), 0, 0, 1, 1);
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void panel_BiTian_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_BiTian, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void panel_Button_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_Button, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            return ((keyData == Keys.Tab) || base.ProcessCmdKey(ref msg, keyData));
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        private void txt_AccountMoney_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((((e.KeyChar < '0') || (e.KeyChar > '9')) && (e.KeyChar != '\b')) && (e.KeyChar != '.'))
            {
                e.Handled = true;
            }
        }

        private void txt_AccountName_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.txt_AccountMoney.Select();
            }
        }

        private void txt_AccountNum_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.btn_Save.Select();
            }
        }
    }
}

